package com.nowcoder.community.service;

import com.nowcoder.community.entity.LoginTicket;
import com.nowcoder.community.entity.User;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.security.core.GrantedAuthority;

import javax.annotation.Resource;
import java.util.Collection;
import java.util.Map;

/**
 * 功能描述
 *
 * @author 21775
 * @date 2022/09/14  10:46
 */
public interface UserService {
    User findUserById(Integer userId);

    User findUserByName(String username);

    User findUserByEmail(String email);

    Map<String,Object> register(User user);

    int activation(int userId,String code);

    Map<String,Object> login(String username,String password,long expiredSeconds);

    void logout(String ticket);

    LoginTicket selectByTicket(String ticket);

    int updateHeader(int userId, String headerUrl);

    void updatePassword(int userId,String newPassword);

    Collection<? extends GrantedAuthority> getAuthorities(int userId);
}
